/*
 * @Author: byron
 * @Date: 2022-01-18 22:59:14
 * @LastEditTime: 2022-02-04 21:15:10
 */

// 防抖函数
const debounce = {
    inserted: function (el, binding) {
        let timer
        el.addEventListener('click', () => {
            if (timer) {
                clearTimeout(timer)
            }
            timer = setTimeout(() => {
                binding.value()
            }, 3000)
        })
    },
}


export default debounce